import {requestService} from '/src/utils/request'

// 查询角色列表
export function getRoleList(query) {
    return requestService({
        url: '/xiaozhen-system/sysRole/list',
        method: 'get',
        params: query
    })
}

// 新增角色
export function addRole(data) {
    return requestService({
        url: '/xiaozhen-system/sysRole/addSysRole',
        method: 'post',
        data: data
    })
}

// 修改角色
export function updateRole(data) {
    return requestService({
        url: '/xiaozhen-system/sysRole/updateSysRole',
        method: 'put',
        data: data
    })
}

// 删除角色
export function deleteRole(roleId) {
    return requestService({
        url: '/xiaozhen-system/sysRole/' + roleId,
        method: 'delete'
    })
}

// 分配角色菜单权限
export function assignMenuPermission(data) {
    return requestService({
        url: '/xiaozhen-system/sysRole/assignMenuPermission',
        method: 'put',
        data: data
    })
}
